import { request } from '@/service/request';

// ------------ Recycle ------------

/** get recycle list */
export function fetchGetRecycleList(params?: Api.Dimo.RecycleSearchParams) {
  return request<Api.Dimo.RecycleList>({
    url: '/dm_recycle/page',
    method: 'GET',
    params
  });
}


/** add recycle info */
export function fetchAddRecycle(data: Api.Dimo.RecycleEdit) {
  return request<boolean>({
    url: '/dm_recycle/',
    method: 'POST',
    data
  });
}

/** update recycle info */
export function fetchUpdateRecycle(data: Api.Dimo.RecycleEdit) {
  return request<boolean>({
    url: '/dm_recycle/',
    method: 'PUT',
    data
  });
}

/** edit delete recycle */
export function fetchDeleteRecycle(data: Api.Common.DeleteParams) {
  return request<boolean>({
    url: '/dm_recycle/',
    method: 'DELETE',
    data
  });
}

/** auth */
export function fetchAuthRecycle(data: { id: string; status: string; authRejectReason: string }) {
  return request<boolean>({
    url: `/dm_recycle/auth`,
    method: 'PUT',
    data
  });
}

// 导出

export function fetchAuthRecycleExport(data: Api.Dimo.DmExportParams) {
  return request<boolean, 'blob' | 'json'>({
    url: `/dm_recycle/export_data`,
    method: 'POST',
    data,
    responseType: 'blob'
  });
}
